package com.space.user.domain.account.valueobject;

import com.space.components.exception.Assert;
import com.space.components.exception.ExceptionFactory;
import lombok.Getter;

/**
 * @author <a href="mailto:414563035@qq.com">Bedroom</a>
 * @date 2021/4/26 3:41 下午
 */
@Getter
public class UserId {
    private final Integer userId;
    public UserId(Integer userId) {
        Assert.notNull(userId);
        if (userId < 0) {
            throw ExceptionFactory.bizException("UserId不能小于0");
        }
        this.userId = userId;
    }
}
